def quick_sort(nums: list[int]) -> list[int]:
    if not nums: return []
    smaller = []
    larger = []
    equal = []
    for c in nums:
        if c < nums[0]:
            smaller.append(c)
        elif c > nums[0]:
            larger.append(c)
        else:
            equal.append(c)
    smaller = quick_sort(smaller)
    larger = quick_sort(larger)
    end = smaller + equal + larger
    return end


if __name__ == '__main__':
    nums = [1, 4, 2, 6, 3, 3, 5, 6, 30, 4, 4, 4, 24, 4, 4, 5]
    nnn = quick_sort(nums)
    print(nnn)
